<template>
	<view class="z-cell">
		<view class="z-cell-item">
			<view class="left">
				<image :src="icon" style="width: 38rpx;" mode="widthFix" v-if='icon'> </image>
				<view class="label">{{label}}</view>
			</view>
			
			<view class="right">
				<view class="content">{{content}}</view>
				<slot name="right-icon" class="right-icon"></slot>
				<image :src="getImageUrl('ic_arrow_right_grey.png')" style="width: 30rpx;" mode="widthFix" v-if='arrow'></image>
			</view>
		</view>
		<view class="line">
		</view>
	</view>
	
</template>

<script>
	export default {
		name:"cell-item",
		data() {
			return {
				
			};
		},
		props:{
			label: {
				type: String,
			},
			icon: {
				type: String,
			},
			content: {
				type: String,
			},
			arrow: {
				type: Boolean,
				default: function(){
					return true
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.z-cell{
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		
		.z-cell-item{
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: space-between;
			background-color: white;
			padding: 30rpx;
			
			.left{
				display: flex;
				flex-direction: row;
				align-items: center;
				width: 150rpx;
				
				.label{
					font-size: 28rpx;
					color: #555;
				}
			}
			
			.right{
				display: flex;
				flex-direction: row;
				flex-wrap: wrap;
				align-items: center;
				justify-content: end;
				flex:1;
				
				.content{
					display: flex;
					flex-direction: row;
					flex-wrap: wrap;
					line-height: 1;
					font-size: 28rpx;
					align-items: r;
					color: #222;
				}
				
				.right-icon{
					display: flex;
					flex-direction: row;
					flex-wrap: wrap;
					flex: 1;
					line-height: 1;
					font-size: 28rpx;
					color: #222;
				}
			}
		}
		
		.line{
			width: 100%;
			height: 1px;
			content: '';
			background-color: '#8a8a8a';
		}
	}
	
</style>